docs(metadata-core): correct createFieldPresenceProbe's stated reason — organization_id is provisioned unconditionally - #13810
Conversation
… — the organization_id column is provisioned unconditionally Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01F3jdziLbAPGeceVNmSox5L
…rection Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01F3jdziLbAPGeceVNmSox5L
…eld-presence-probe-docstring
📓 Docs Drift Check
What this run could not see
Coarse fallback — 3 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): |
PM review: ACCEPT, pending greenReviewed against the dispatch order (#13416 comment 5478571701). CI is still running; this review is independent of it. Release follows on full green — ⛔ enqueue bar is EVERY check, not the required subset. ⭐⭐ The headline: the seat falsified the card's own decisive evidence, and the fix survives anywayThe card's third re-check command was offered as its sharpest proof — "The third command prints nothing, which is the point." Running it with a control found two errors in the card:
⇒ A zero that had drifted into a one, in a file that was never the right file. Had the seat re-run the card's command and stopped at "hmm, 1 hit, premise broken", it would have reported a false STOP. Instead it traced to the real definition and confirmed the substantive claim holds: signature The positive control fired — ⭐ The sharpest evidence in the PR is one the card never had
Four independent in-tree sources agree, including one the card did not cite: Census re-measured, with the unread declaration declaredThe card's 117 / 92 / 25 predate #13491. Re-measured by running the real Changeset measured, not assumed — including the re-exportThe order warned not to take
|
Green — releasingAll 32 checks success or skipped, zero failures: all six One thing not yet on this PR: the docs-drift blind spot, checkedThe drift bot reported a blind spot rather than a finding — ⭐ That is worth closing rather than waving through, because this card's own thesis is "how a docstring becomes the last place a wrong fact survives" — correcting the JSDoc while an identical stale claim sat in a docs page would merely relocate the defect. Searched
⇒ That is precisely what this PR corrects the docstring to say. The docs site and the JSDoc will agree once this lands — and it is a fifth independent corroborating source, on top of the four the PR already cites ( The other two hits are release-owned ( Releasing: draft cleared, auto-merge enabled. ⛔ Not merged by this seat, and no approving review from it. Generated by Claude Code |
Fixes #13416
createFieldPresenceProbe's docstring recorded a falsified fact as the probe's reason for existing:The stated reason is corrected. The probe itself is untouched — its implementation is byte-identical. Deleting it as dead is the exact wrong move the stale sentence invited, and it still has real work: what it answers is provenance, not posture.
What is true now
The
organization_idCOLUMN is provisioned unconditionally, subject only to the explicit opt-outs (systemFields: false,systemFields.tenant: false,managedBy: 'better-auth',tenancy.enabled: false). The multi-tenant flag now governs only whether the column is INDEXED, never whether it EXISTS. The sentence is corrected and its history kept rather than dropped — the convention this repo already uses for a fact whose owner changed.Four independent sources in the tree agree, three of them the card's and one it did not cite:
packages/objectql/src/registry.tspackages/spec/src/data/injected-system-columns.tsresolveInjectedSystemColumns(def: unknown)— one parameter, the object definition. NomultiTenantto decide with.packages/objectql/src/registry-tenancy-posture.test.tsRe-located needles (the card measured at
090f2302e; main has moved)Re-found by quoted prose, never by line number.
"Why the probe exists at all: the SchemaRegistry auto-injects"— card saidrecord-organization.ts:56-58, still at 56-58. No drift."The \organization_id` COLUMN is provisioned unconditionally"— card saidregistry.ts:509-517`; the block now sits at 508-518 (start drifted by -1; the card cited a sub-range of an 11-line block)."which is exactly how a docstring becomes the last place a wrong fact survives"—packages/drivers/driver-sql/src/sql-driver.ts:11888. Echoed in the replacement prose.The card's
multiTenantzero — re-run with a positive controlThe card's third re-check command was "prints nothing, which is the point." It now prints one line, and the file it names is not where the function lives. The substantive claim survives both corrections:
git grep -n "multiTenant" -- packages/spec/src/data/injected-system-column-provenance.ts→ 1 hit,:102, a historical prose mention: "(meta:applySystemFieldsstampsindexedonorganization_id— a keyFieldSchemarejects by name, so every registry-backed object read answers_diagnostics: { valid: false }#6810 removed theindexed: opts.multiTenantthat used to be; the tenant index is declared in the object'sindexes[]instead.)". Not an input.resolveInjectedSystemColumns→ 6 hits. The filter was live, so the reading above is a reading rather than a dead grep.resolveInjectedSystemColumnsis defined in the siblingpackages/spec/src/data/injected-system-columns.ts:139; the provenance file imports it at:42. The quoted docstring "the flag cannot change what EXISTS, only what is indexed" isregistry.ts:517-518, not the provenance file's own.multiTenantinput. Signature is(def: unknown);tenantis computed at:163assf?.tenant !== false && !isTenancyDisabled(obj).Census re-measured (the card's 117 / 92 / 25 predate #13491)
packages/objectql/src/tenancy/platform-object-tenancy.tsis present in this tree, so the reclassification has landed. Re-measured by running the realresolveInjectedSystemColumnsover every declaration, at this PR's head:*.object.tsfiles, 116 object declarations readmanagedBy: 'better-auth', 2 bymanagedBy: 'better-auth'+tenancy.enabled: falseOne further declaration (
blank_note, thecreate-objectstackblank template) could not be imported — it resolves@objectstack/specoutside the workspace graph — so 117 candidate declarations, 1 unread. The qualitative claim is what carries the fix, and it holds: nothing is excluded by posture.Decisive for the two tables the old sentence named:
sys_audit_logandsys_activityboth carrymanagedBy: 'append-only', neither declaresorganization_iditself, and both resolvetenant: truewithorganization_idin the injected plan — on every posture.Why a changeset, and why
patchNot assumed from "prose only" — measured.
createFieldPresenceProbeis a published export of@objectstack/metadata-core, and the falsified sentence was emitted verbatim into the built declarations, so it is what a consumer's editor showed on hover:packages/metadata-core/dist/index.d.ts:20159anddist/index.d.cts:20612carried the stale sentence before this change; after the rebuild both carry the corrected text.@objectstack/plugin-auditre-exports the symbol but its declarations do not inline the JSDoc —dist/index.d.ts:3is a bareexport { createFieldPresenceProbe } from '@objectstack/metadata-core';, and a grep for the new text there returns 0. So the changeset names@objectstack/metadata-coreonly.Verification — all at final commit
d28e026558pnpm --filter @objectstack/metadata-core test— 15 files, 261 tests, all passpnpm --filter @objectstack/metadata-core typecheck— green (tsc --noEmitandtsc --noEmit -p tsconfig.test.json, so the test program is covered too)eslint . --no-inline-configover the repo — 5574 files, 0 errors, 0 warnings. Run whole, not narrowed.node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack --commands(27 families, re-derived after the merge with main and identical to the pre-merge derivation): 25 green, 2 NOT MEASURED, neither a red:check-test-completenessexit 3 — "PREREQUISITE NOT MET … the local reading for this gate is NOT MEASURED"; it grades a savedturbo run testlog CI tees and this invocation has none.check:dual-build-cjs-loadsexit 3 — "PREREQUISITE NOT MET — this gate reads built output, and some package has no dist/"; it needs a whole-workspacepnpm build, which is CI's run.pnpm check:nul-bytes— green (7586 files, self-test 75 assertions); plus a direct control-byte scan of both changed files, no hits.Builds were serialised through
scripts/pm/os-verify-lock.sh; every result above is read from the gate's own verdict line, with the exit code captured before any pipe.Scope
Prose in one docstring, plus its changeset. No code, no test, no index, no behaviour. Deliberately not claimed: which commit moved the provisioning off the flag — the card declines to assert it and it is not needed to correct the sentence. #13433 and #13434 are separate cards and are not addressed here.
Generated by Claude Code